class_name DetectComponent
extends BaseComponent

## Detector组件

#region 属性
var detector_dict:Dictionary[GameEnum.DetectorType,Detector] = {}
#endregion
#region 字段
#endregion
#region 信号
#endregion

#region 基类方法
func init_component(args:Dictionary = {}):
	super(args)
	for child in get_children():
		if child is Detector and not detector_dict.has(child.detector_type):
			child.init(entity)
			detector_dict.set(child.detector_type,child)
#endregion
#region 公共方法
func get_detector(detector_type:GameEnum.DetectorType) -> Detector:
	return detector_dict.get(detector_type,null)
#endregion
#region 私有方法
#endregion
#region 生命周期函数
func _process(delta: float) -> void:
	if not inited:
		return
	for detector:Detector in detector_dict.values():
		detector.update(delta)
#endregion
